package com.example.panpan.impl;



import com.example.panpan.Service.GoodsService;
import com.example.panpan.dao.GoodsDao;
import com.example.panpan.domain.GoodsEntity;
import com.example.panpan.domain.GoodsResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("goodsServiceImpl")
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsDao goodsDao;

    @Override
    public List<GoodsResponse> getGoods(String title) {
        return goodsDao.getGoods(title);
    }

    @Override
    public GoodsEntity getGoodsById(int id) {
        return goodsDao.getGoodsById(id);
    }

    @Override
    public void insertEntity(GoodsEntity goodsEntity) {
        goodsDao.insertEntity(goodsEntity);
    }

    @Override
    public void updateEntity(GoodsEntity goodsEntity) {
        goodsDao.updateEntity(goodsEntity);
    }

    @Override
    public List<GoodsEntity> goodsList(String cid, int pageSize, int start) {
        return goodsDao.goodsList(cid,pageSize,start);
    }

    @Override
    public Integer goodsSize(String cid, int pageSize, int start) {
        return goodsDao.goodsSize(cid,pageSize,start);
    }

    @Override
    public void deleteGoods(List<String> groupId) {
        goodsDao.deleteGoods(groupId);
    }
}
